﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Print.aspx.cs" Inherits="Print" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>打印</title>
    <style type="text/css" media="print">
    .Noprint{ DISPLAY: none }
    </style>
     <link rel="stylesheet" type="text/css" media="screen,projection,print" href="Theme/Stander/css/layout1_text.css" />
     <link rel="stylesheet" type="text/css" media="screen,projection,print" href="Theme/Stander/css/layout1_setup.css" />
      <script language="javascript" type="text/javascript">
        function load()
        {
            try {
                var printDiv=document.getElementById("printDiv");
                printDiv.innerHTML=window.opener.parent.parent.document.getElementById('<%=Request.QueryString["id"] %>').innerHTML;
            
                factory.printing.header = "";
                factory.printing.footer = "";
                factory.printing.portrait = false;
                factory.printing.portrait = false;
                factory.printing.leftMargin = 10;
                factory.printing.topMargin = 10;
                factory.printing.rightMargin = 10;
                factory.printing.bottomMargin = 10;
                
                //ScriptX http://www.meadroid.com/scriptx/index.asp
                //Doc http://www.meadroid.com/scriptx/docs/printdoc.htm
                  // -- advanced features
//                factory.printing.SetMarginMeasure(2); // measure margins in inches
//                factory.printing.printer = "HP DeskJet 870C";
//                factory.printing.paperSize = "A4";
//                factory.printing.paperSource = "Manual feed";
//                factory.printing.collate = true;
//                factory.printing.copies = 2;
//                factory.printing.SetPageRange(false, 1, 3); // need pages from 1 to 3

            }
            catch(e) { }
//          factory.printing.printsize="100%"; 
        }
        
</script>
</head>
<body onload="load();">
<div id="printDiv">

</div>
<object id="factory" viewastext style="display:none"
  classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
  codebase="smsx.cab#Version=6,3,435,20">
</object>

<input type="button" value="打印"    onclick="javascript:factory.printing.Print(false);" class="Noprint"/>
<input type="button" value="页面设置" onclick="javascript:factory.printing.PageSetup();" class="Noprint"/>
<input type="button" value="打印预览" onclick="javascript:factory.printing.Preview();" class="Noprint"/>
</body>
</html>
